<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		[#include "/html/include/easyuicss.html" /]
		[#include "/html/include/easyuijs.html" /]
		<script type="text/javascript" src="${app }/static/js/common.utils.js"></script>
		<style type="text/css">
			img {
				max-width: 180px;
			}
		</style>
	</head>
	<body>
	<table id="dgtable" class="easyui-datagrid" style="width:100%;height:100%;">
		<thead>
		<tr>
			<th field="title" width="120">标题</th>
			<th field="description" width="220">摘要</th>
			<th field="image_url" width="190">图片</th>
			<th field="url" width="160">外部链接</th>
			<th field="opt" width="50">操作</th>
		</tr>
		</thead>
		[#list items as item]
		<tr>
			<td>${item.title}</td>
			<td>${item.description}</td>
			<td><img src="${imgSite}/${item.image_url}" /></td>
			<td>${item.url}</td>
			<td><a href="javascript:;" class="easyui-linkbutton" onclick="deleteInfo('${item.id}');">删除</a></td>
		</tr>
		[/#list]
	</table>
	</body>
    <script type="text/javascript">
		$(document).ready(function(){

		});
		function deleteInfo(id){
			$.messager.confirm('系统提醒', '您确定要删除该条记录吗？', function(r){
				if (r){
					parent.layer.load(2);
					common.ajax('${app}/weixin/newsmgr/deleteItem.do', 'id='+id,
						'POST', 'json', false,
						function(result){
							parent.layer.closeAll('loading');
							parent.easyui.msgShow('系统提醒', result.msg, 3000, 250, 100);
							window.location.reload();
						}
					);
				}
			});
		}
    </script>
</html>